Skip to content

fix deadloop when visit ElvisOperatorExpression - #102

Open
cosven wants to merge 1 commit into
GroovyLanguageServer:masterfrom
cosven:fix-elvis
Open

fix deadloop when visit ElvisOperatorExpression#102
cosven wants to merge 1 commit into
GroovyLanguageServer:masterfrom
cosven:fix-elvis

Conversation

@cosven

@cosven cosven commented May 19, 2025

Copy link
Copy Markdown

Before, the visitShortTernaryExpression method pushes the node to the stack, and the visitShortTernaryExpression method pushes the node to the stack again. Then the node's parent is the node itself. It causes deadloop in getParent method.

trustytrojan added a commit to trustytrojan/groovy-language-server that referenced this pull request May 27, 2026
Prevent `groovy-all:jar` dependency from breaking resolution
trustytrojan added a commit to trustytrojan/groovy-language-server that referenced this pull request Aug 20, 2026
* Add Jenkinsfile support via GDSL and semantic token/highlighting support

Works in VS Code via the https://github.com/cosven/easy-groovy extension

* update readme

* show proper hovers for methods defined in GDSL

* detect methods of supertypes in method call expressions

* Add semantic token support

* manually merge in `semantic-tokens` branch

* Use one output channel instead of creating/deleting several (happens when restarting language server)

* fix vscode extension `range` object access error

* Improved GDSL system by removing hacky workarounds and creating `MethodNode`s on script classes to act as globally available methods

* Hardcode `Map` and `Closure` class checks because Jenkins GDSL provides them unqualified in strings

* Add Maven API to download Jenkins Plugin JARs for typical Jenkins plugins

Inject GDSL property symbols into script classes

Inject methods from `DefaultGroovyMethods` with an `Object` first parameter into `ClassHelper.OBJECT_TYPE`

* Bump LSP4J to 0.20.0 for `CompletionItemLabelDetails` to get a better completion menu for property/method access

* Fix `(DGM)` indicator to be in `CompletionItemLabelDetails.description` to indicate a method as being from `DefaultGroovyMethods`

* Fix property access completion item menus for GDSL global objects

* Modify test cases to check `CompletionItemLabelDetails` and use it for `ClassNode` & `Variable` completions

* Implement go-to-definition for implicit script class `ClassExpression`s and `ImportNode`s where otherwise scripts were required to return an expression (last statement is an expression)

Fix `NullPointerException` when requesting references for a `ClassExpression` of an implicit script class within the same file

Add tests to `GroovyServicesDefinitionTests` for implicit script class definition requests

* Add `dependencies` configuration option to specify maven repository/dependencies to download and use as classpaths

* Send semantic tokens for class symbols/references, including within import statements

* oops should have kept these strings

* Solve the source of the "GDSL globals not being typed" issue

* Add name to copyright notices where I modified code

* Add/modify copyright notices

* Use types of named parameters from GDSL

* Make hovers work on GDSL globals injected as script class fields

* Don't color in undefined nodes, color all Closure variables as functions

* Apply GroovyLanguageServer#102

Prevent `groovy-all:jar` dependency from breaking resolution

* let's not cause the same problem in `HoverProvider`

* Fix `NullPointerException` and change dependency exclusion comment

* Clean up `injectDefaultGroovyMethods` and extend it to all types instead of just `Object`

* Visit all supertypes when getting methods, fields, or properties of a `ClassNode`

Only return public methods/fields/properties

* Restrict hovers and semantic tokens based on member visibility

* HUGE semantic tokens refactor; `def` and `var` are type tokens; hovers on `def` and `var` show the initializing expression's type; `readonly` modifier is working with `final` variables/fields.

* Add self to copyright notices where I modified files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant